<extend name="Common/back" xmlns="http://www.w3.org/1999/html"/>

<block name="content">
    <div id="content">
        <div class="page-header">
            <div class="container-fluid">
                <div class="pull-right">
                    <button type="submit" form="form-set" data-toggle="tooltip" title="保存" class="btn btn-primary">
                        <i class="fa fa-save"></i>
                    </button>
                    <a href="{:U('list')}" data-toggle="tooltip" title="取消" class="btn btn-default">
                        <i class="fa fa-reply"></i>
                    </a>
                </div>
                <h1>分类</h1>
                <ul class="breadcrumb">
                    <li>
                        <a href="{:U('Manage/index')}">首页</a>
                    </li>
                    <li>
                        <a href="javascript:;">分类</a>
                    </li>
                </ul>
            </div>
        </div>
        <div class="container-fluid">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title">
                        <i class="fa fa-pencil"></i>
                        设置分类
                    </h3>
                </div>
                <div class="panel-body">
                    <form action="{:U('set')}" method="post" enctype="multipart/form-data" id="form-set"
                    class="form-horizontal">
                        <if condition="isset($data['category_id'])">
                            <input type="hidden" name="category_id" value="{$data['category_id']}" id="input-category_id">
                        </if>
                        <ul class="nav nav-tabs">
                            <li class="active">
                                <a href="#tab-general" data-toggle="tab">基本信息</a>
                            </li>
                            <li class="">
                                <a href="#tab-seo"  data-toggle="tab">SEO信息</a>
                            </li>
                        </ul>
                        <div class="tab-content">
                            <div class="tab-pane active" id="tab-general">

                     <div class="form-group" >
                <label class="col-sm-2 control-label" for="input-category_title">分类</label>
                  <div class="col-sm-10">
                 <input type="text" class="form-control" placeholder="分类"
                 name="category_title" id="input-category_title" value="{$data['category_title']}"/>
                 <if condition="isset($message['category_title'])">
                 <label for="input-category_title" class="text-danger">{$message['category_title']}</label>
              </if>
             </div>
            </div>
                 <div class="form-group">
                <label class="col-sm-2 control-label" for="input-parent_id">上级分类</label>
                  <div class="col-sm-10">
                 <select  class="form-control"  name="parent_id" id="input-parent_id">
                     <volist name="category_list" id="category">
                         <option value="{$category['category_id']}"><if condition="$category['category_id']
                        eq $data['parent_id']">select</if>
                             {:str_repeat('&nbsp;',$category['deep']*2)}{$category['category_title']}</option>
                     </volist>
                  </select>
                 <if condition="isset($message['parent_id'])">
                 <label for="input-parent_id" class="text-danger">{$message['parent_id']}</label>
              </if>
             </div>
            </div>
              <div class="form-group">
                <label class="col-sm-2 control-label" for="input-is_used">启用</label>
              <div class="col-sm-10">
                 <input type="text" class="form-control" placeholder="启用"
                 name="is_used" id="input-is_used" value="{$data['is_used']}"/>
                 <if condition="isset($message['is_used'])">
                 <label for="input-is_used" class="text-danger">{$message['is_used']}</label>
              </if>
             </div>
            </div>
                 <div class="form-group">
                <label class="col-sm-2 control-label" for="input-is_nav">是否导航</label>
                  <div class="col-sm-10">
                 <input type="text" class="form-control" placeholder="是否导航"
                 name="is_nav" id="input-is_nav" value="{$data['is_nav']}"/>
                 <if condition="isset($message['is_nav'])">
                 <label for="input-is_nav" class="text-danger">{$message['is_nav']}</label>
              </if>
             </div>
            </div><div class="form-group">
                <label class="col-sm-2 control-label" for="input-meta_title">META标题</label>
                  <div class="col-sm-10">
                 <input type="text" class="form-control" placeholder="META标题"
                 name="meta_title" id="input-meta_title" value="{$data['meta_title']}"/>
                 <if condition="isset($message['meta_title'])">
                 <label for="input-meta_title" class="text-danger">{$message['meta_title']}</label>
              </if>
             </div>
            </div><div class="form-group">
                <label class="col-sm-2 control-label" for="input-meta_keywords">META关键字</label>
                  <div class="col-sm-10">
                 <input type="text" class="form-control" placeholder="META关键字"
                 name="meta_keywords" id="input-meta_keywords" value="{$data['meta_keywords']}"/>
                 <if condition="isset($message['meta_keywords'])">
                 <label for="input-meta_keywords" class="text-danger">{$message['meta_keywords']}</label>
              </if>
             </div>
            </div><div class="form-group">
                <label class="col-sm-2 control-label" for="input-meta_description">META描述</label>
                  <div class="col-sm-10">
                 <input type="text" class="form-control" placeholder="META描述"
                 name="meta_description" id="input-meta_description" value="{$data['meta_description']}"/>
                 <if condition="isset($message['meta_description'])">
                 <label for="input-meta_description" class="text-danger">{$message['meta_description']}</label>
              </if>
             </div>
            </div><div class="form-group">
                <label class="col-sm-2 control-label" for="input-sort_number">排序</label>
                  <div class="col-sm-10">
                 <input type="text" class="form-control" placeholder="排序"
                 name="sort_number" id="input-sort_number" value="{$data['sort_number']}"/>
                 <if condition="isset($message['sort_number'])">
                 <label for="input-sort_number" class="text-danger">{$message['sort_number']}</label>
              </if>
             </div>
            </div>

                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</block>

<block name="appendJs">
    <script src="__PUBLIC__/Back/validate/jquery.validate.min.js"></script>
    <script src="__PUBLIC__/Back/validate/additional-methods.min.js"></script>
    <script src="__PUBLIC__/Back/validate/localization/messages_zh.min.js"></script>

    <script>
    // 表单的JS验证
        $(function(){
            $('#form-set').validate({});
        });
    </script>

</block>